package cool.taomu.toolkit.test

import com.google.inject.AbstractModule
import cool.taomu.toolkit.cacheable.Cacheable
import org.junit.jupiter.api.Test
import cool.taomu.toolkit.Taomu

class CacheableTest {

    @Cacheable("taomu.cacheable.name.redis")
    def String b() {
        return "Hello World CacheableTest";
    }

    @Test
    def void a() {
        var a = Taomu.injector.createChildInjector(new AbstractModule(){
            override configure(){
                bind(CacheableTest)
            }
        })
        var aa = a.getInstance(CacheableTest)
        println(aa.b());
        println(aa.b());
    }
}
